package com.justonetech.translation.domain.base;

import com.justonetech.system.domain.SysCodeDetail;
import com.justonetech.translation.domain.Document;
import com.justonetech.translation.domain.Project;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.io.Serializable;


/**
 * This is an object that contains data related to the project table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * TableComment : 项目
 * SyncTemplatepatterns : list\w*
 * SyncDao : false
 * TableName : 项目
 * SyncBoolean : get
 * SyncJsp : true
 * Treeable : false
 * Projectable : false
 *
 * @hibernate.class
 *  table="project"
 */
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})
public abstract class BaseProject  implements Serializable{

	public static String REF = "Project";
	public static String PROP_TYPE = "type";
	public static String PROP_END_DATE = "endDate";
	public static String PROP_WORD_COUNT = "wordCount";
	public static String PROP_SOUCE_LANGUAGE = "souceLanguage";
	public static String PROP_REQUIREMENT = "requirement";
	public static String PROP_DOC = "doc";
	public static String PROP_CODE = "code";
	public static String PROP_START_DATE = "startDate";
	public static String PROP_NAME = "name";
	public static String PROP_STATUS = "status";
	public static String PROP_TARGET_LANGUAGE = "targetLanguage";
	public static String PROP_SOURCE_NAME = "sourceName";
	public static String PROP_ID = "id";


	// constructors
	public BaseProject () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseProject (Long id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private Long id;

	// fields
    /*项目名称*/
    /*项目名称*/
	private String name;
	
    /*项目编号*/
    /*项目编号*/
	private String code;
	
    /*项目类型*/
    /*项目类型*/
	private SysCodeDetail type;
	
    /*原稿名称*/
    /*原稿名称*/
	private String sourceName;
	
    /*原语言*/
    /*原语言*/
	private SysCodeDetail souceLanguage;
	
    /*目标语言*/
    /*目标语言*/
	private SysCodeDetail targetLanguage;
	
    /*翻译字数*/
    /*翻译字数*/
	private java.math.BigDecimal wordCount;
	
    /*要求*/
    /*要求*/
	private String requirement;
	
    /*开始时间*/
    /*开始时间*/
	private java.sql.Date startDate;
	
    /*结束时间*/
    /*结束时间*/
	private java.sql.Date endDate;
	

    private String status;
	// many to one
	private Document doc;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="com.justonetech.core.orm.hibernate.LongIdGenerator"
     *  column="ID"
     */
	public Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 * @deprecated
	 */
	public void setId (Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: NAME
	 */
	public String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: NAME
	 * @param name the NAME value
	 */
	public void setName (String name) {
		this.name = name;
	}


	/**
	 * Return the value associated with the column: CODE
	 */
	public String getCode () {
		return code;
	}

	/**
	 * Set the value related to the column: CODE
	 * @param code the CODE value
	 */
	public void setCode (String code) {
		this.code = code;
	}


    public SysCodeDetail getType() {
        return type;
    }

    public void setType(SysCodeDetail type) {
        this.type = type;
    }

    /**
	 * Return the value associated with the column: SOURCE_NAME
	 */
	public String getSourceName () {
		return sourceName;
	}

	/**
	 * Set the value related to the column: SOURCE_NAME
	 * @param sourceName the SOURCE_NAME value
	 */
	public void setSourceName (String sourceName) {
		this.sourceName = sourceName;
	}


    public SysCodeDetail getSouceLanguage() {
        return souceLanguage;
    }

    public void setSouceLanguage(SysCodeDetail souceLanguage) {
        this.souceLanguage = souceLanguage;
    }

    public SysCodeDetail getTargetLanguage() {
        return targetLanguage;
    }

    public void setTargetLanguage(SysCodeDetail targetLanguage) {
        this.targetLanguage = targetLanguage;
    }

    /**
	 * Return the value associated with the column: WORD_COUNT
	 */
	public java.math.BigDecimal getWordCount () {
		return wordCount;
	}

	/**
	 * Set the value related to the column: WORD_COUNT
	 * @param wordCount the WORD_COUNT value
	 */
	public void setWordCount (java.math.BigDecimal wordCount) {
		this.wordCount = wordCount;
	}


	/**
	 * Return the value associated with the column: REQUIREMENT
	 */
	public String getRequirement () {
		return requirement;
	}

	/**
	 * Set the value related to the column: REQUIREMENT
	 * @param requirement the REQUIREMENT value
	 */
	public void setRequirement (String requirement) {
		this.requirement = requirement;
	}


	/**
	 * Return the value associated with the column: START_DATE
	 */
	public java.sql.Date getStartDate () {
		return startDate;
	}

	/**
	 * Set the value related to the column: START_DATE
	 * @param startDate the START_DATE value
	 */
	public void setStartDate (java.sql.Date startDate) {
		this.startDate = startDate;
	}


	/**
	 * Return the value associated with the column: END_DATE
	 */
	public java.sql.Date getEndDate () {
		return endDate;
	}

	/**
	 * Set the value related to the column: END_DATE
	 * @param endDate the END_DATE value
	 */
	public void setEndDate (java.sql.Date endDate) {
		this.endDate = endDate;
	}

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    /**
	 * Return the value associated with the column: DOC_ID
	 */
	public Document getDoc () {
		return doc;
	}

	/**
	 * Set the value related to the column: DOC_ID
	 * @param doc the DOC_ID value
	 */
	public void setDoc (Document doc) {
		this.doc = doc;
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof Project)) return false;
		else {
			Project project = (Project) obj;
			if (null == this.getId() || null == project.getId()) return false;
			else return (this.getId().equals(project.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		ToStringBuilder builder = new ToStringBuilder(this);
		builder.append(id);
		builder.append(name);
		builder.append(code);
		builder.append(type);
		builder.append(sourceName);
		builder.append(souceLanguage);
		builder.append(targetLanguage);
		builder.append(wordCount);
		builder.append(requirement);
		builder.append(startDate);
		builder.append(endDate);
		return builder.toString();
	}


}